/**
 * Created by jt on 2017/5/8.
 */
import "./index.less";
// import "../../../unit/common/js/common/main_portal.js";

var artclId = getArgs().id;

jQuery.ajax({
    url: HOST_ADDR+'/cpmp/artcl/view/'+artclId,
    type: 'get',
    dataType: 'json',
    contentType:"application/json",
    success: function(resp){
        if (!resp.success) {
            alert(resp.msgCod+' '+resp.msgInf);
            return;
        }

        console.log(resp)

        var crtTimFmt = (new Date(resp.data.crtTim)).Format("yyyy-MM-dd hh:mm");

        jQuery('.artclTtl').html(resp.data.artclTtl+'<div class="service-block-v5 margin-top-20">' +
            '<p class="fontsize-14"> 时间：'+crtTimFmt+'</p></div>');

        jQuery('.artclCtt').html(resp.data.artclCtt);

        var atches = resp.data.atches;
        if(atches!=null && atches!='' && atches.length > 0){
            for (var i= 0;i<atches.length;i++) {
                jQuery('.artclCtt').append('<br><a href="'+HOST_FILE+atches[i].atchUrl+'" >'+atches[i].atchNam+'</a>');
            }
        }
    },
    error:function(err){
        alert('系统错误！');
    }
});